package cn.edu.whut.commonapi.core.domain;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import lombok.Data;

@Data
@Schema(description = "分页参数 Request DTO")
public class PageEntity {

    /** 当前记录起始索引 */
    @Schema(description = "当前记录起始索引", example = "0", requiredMode = Schema.RequiredMode.REQUIRED)
    @Min(value = 0, message = "当前记录起始索引不能小于0")
    private Integer pageNum;

    /** 每页显示记录数 */
    @Schema(description = "每页显示记录数", example = "10", requiredMode = Schema.RequiredMode.REQUIRED)
    @Min(value = 1, message = "每页显示记录数不能小于1")
    @Max(value = 100, message = "每页显示记录数不能大于100")
    private Integer pageSize;

}
